//引入插件
import VueRouter from "vue-router";
//引入vue
import Vue from "vue";
//使用插件
Vue.use(VueRouter);

//引入一级路由组件:四个
import Home from '@/pages/Home';
import Search from '@/pages/Search';
import Login from '@/pages/Login';
import Register from '@/pages/Register';

export default new VueRouter({
    routes:[
        {
          //K
          path:'/home',  
          //V 
          component:Home,
          meta:{show:true}
        },
        {
            path:'/search/:keyword?',
            component:Search,
            name:'search',
            meta:{show:true}
        }
        ,
        {
            path:'/login',
            component:Login,
            meta:{show:false}
        }
        ,{
            path:'/register',
            component:Register,
            meta:{show:false}
        }
        ,
        //重定向
        {
          path:"/",
          redirect:'/home'
        }
      ]
})